package com.tebiecloud.store.client.service;

import com.tebiecloud.common.model.ResultBody;
import com.tebiecloud.store.client.model.entity.Store;
import com.tebiecloud.store.client.model.entity.StoreStaff;
import com.tebiecloud.store.client.model.vo.StoreVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * 门店公共接口
 */
public interface IStoreServiceClient {

    /**
     * 获取门店信息
     *
     * @param storeId 门店id
     * @return
     */
    @PostMapping("/feign/store/getstore")
    ResultBody<Store> getStore(@RequestParam("storeId") long storeId);

    /**
     * 获取门店列表
     *
     * @param storeIds 门店id，多个用逗号隔开
     * @return 返回门店列表
     */
    @PostMapping("/feign/store/selectstoreList")
    ResultBody<List<Store>> selectStoreList(@RequestParam("storeIds") String storeIds);

    /**
     * 获取随机门店列表
     *
     * @return
     */
    @PostMapping("/feign/store/list")
    ResultBody<List<Store>> list();

    /**
     * 查询附近门店按距离排序
     *
     * @param lng
     * @param lat
     * @return
     */
    @PostMapping("/feign/store/listBynearby")
    ResultBody<List<StoreVO>> listBynearby(@RequestParam(value = "lng", required = false) Double lng,
                                           @RequestParam(value = "lat", required = false) Double lat,
                                           @RequestParam(value = "storeIds", required = false) String storeIds);

    /**
     * 更新门余额
     *
     * @param storeId
     * @param balance
     * @return
     */
    @PostMapping("/feign/store/updateStoreBalance")
    ResultBody<Store> updateStoreBalance(@RequestParam("storeId") long storeId,
                                         @RequestParam("balance") int balance);

    /**
     * 添加管辖店铺
     * @param name
     * @return
     */
    @PostMapping("/feign/store/select")
    public ResultBody select(@RequestParam("name") String name,
                             @RequestParam("username") String username,
                             @RequestParam("mobile") String mobile,
                             @RequestParam("sex") Integer sex,
                             @RequestParam("userId")Long userId);

    /**
     * agm管辖店铺数量
     * @param userId
     * @return
     */
    @PostMapping("/feign/store/count")
    Integer count(@RequestParam("userId") Long userId);

    /**
     * agm店铺详细信息查询
     * @param userId
     * @return
     */

    @PostMapping("/feign/store/agmxx")
    List<Store> agmxx(@RequestParam("userId") Long userId);


}
